from django.core.exceptions import ImproperlyConfigured

class NotARespondentException(Exception):
    """
    The user is not a respondent
    
    Raised when the user doesn't have questionnaire.answer_questionnaire
    permission
    """

    def __init__(self, user):
        self.user = user
        self.message = "The user '%s' is not a respondent" % self.user

    def __str__(self):
        return self.message


class RespondentProfileImproperlyConfigured(ImproperlyConfigured):
    """
    OPINION_EXTRACTOR['respondent_profile_model'] setting is somehow improperly
    configured
    """
    pass
